<?php

$carrito=$this->carrito;
$nprod=count($carrito);

$desplegable_cont=new div();
$desplegable_cont->att('id','widget_desplegable_cont');
$desplegable_cont->att('class','widgetDesplegable_CONT');

$desplegable=new div();
$desplegable->att('id','widget_desplegable');
$desplegable->att('class','widgetDesplegable');
$desplegable->value='Mi Carrito';

$desplegable_cont->addControl($desplegable);
$cont_main=new div();
$cont_main->att('id','widget_contMain');
$cont_main->att('class','widgetContMain');
$cont_main->att('style','display:none;');



$cont=new div();
$cont->att('id','widget_cont');
$cont->att('class','widgetCont');
//array('0'=>stdClass('id_producto'=>'4', 'nombre'=>'crema 1', 'precio'=> ... ))

//$this->firephp->log($this->carrito);

if($nprod){
	foreach($carrito as $id=>$producto){
		$data['productoAdded']=$producto;
		ob_start();
		$this->load->view('productoAdded_view',$data);
		$cont->value.=ob_get_clean();
	}
	
}

$cont_main->addControl($cont);

$fin= new anchor();
$fin->att('href','carritoResumen');
$fin->value="Finalizar";
$cont_main->addControl($fin);

$desplegable_cont->addControl($cont_main);
echo $desplegable_cont;
?>
